{{!
  Copyright (c) HashiCorp, Inc.
  SPDX-License-Identifier: BUSL-1.1
~}}

<div data-test-error class="empty-message">
  <h3 data-test-error-title class="empty-message-headline">Not Authorized</h3>
  <p data-test-error-message class="empty-message-body">
    {{#if this.token.secret}}
      You currently lack the
      {{#if this.permission}}
        <code>{{this.permission}}</code>
      {{else}}
        required
      {{/if}}
      <LinkTo data-test-permission-link @route="settings.tokens" {{on "click" (action (mut this.token.postExpiryPath) this.router.currentURL)}}>permission</LinkTo> for this resource.<br /> Contact your administrator if this is an error.
    {{else}}
      {{#if this.authMethods}}
        Sign in with
        {{#each this.authMethods as |authMethod|}}
          <LinkTo @route="settings.tokens">{{authMethod.name}}</LinkTo>,
        {{/each}}
        or
      {{/if}}

      {{conditionally-capitalize "provide" (not this.authMethods.length)}} a <LinkTo @route="settings.tokens">token</LinkTo> with the
      {{#if this.permission}}
        <code>{{this.permission}}</code>
      {{else}}
        requisite
      {{/if}}
      permission to view this.
    {{/if}}
  </p>

  {{#unless this.token.secret}}
    <p class="empty-message-body">
      If you have signed in via the Nomad CLI, authenticate with:
      <div class='terminal-container'>
        <pre class='terminal'><span class='prompt'>$</span> nomad ui -authenticate</pre>
      </div>
    </p>
  {{/unless}}
</div>
